Skip to content

Focus management (#66, Part 6) - #73

Merged
n4ff4h merged 6 commits into
devfrom
fix/66-part6-focus
Nov 18, 2026
Merged

n4ff4h merged 6 commits into
devfrom
fix/66-part6-focus

Conversation

@n4ff4h

@n4ff4h n4ff4h commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes the [C] items in Part 6 (focus management) of #66. Each item has a jsdom test that failed first, asserting toHaveFocus() after user-event interactions.

Item Change
6.1 RecordActionsMenu: triggerRef is now attached to the "More actions" button, so a confirmation opened from the menu returns focus to it. The test failed with focus on <body>.
6.2 Editor toolbar: when the control holding the roving tab stop is disabled or hidden (e.g. "Text style" with the caret in a code block), the tab stop moves to the first enabled control, so Tab and Alt+F10 still reach the toolbar. The test failed because no control had tabindex=0.
6.3 BulkActionBar: opening an action's form focuses its control (the element with the form id, or else the first form control). Cancel puts focus back on the action button. The test failed with focus on <body>.
6.4 AdditionalFilesUpload: after a new file is removed, the picker gets focus only once it has re-rendered, which matters at maxFiles, where it was still disabled. FileInput's deferred focus is now a shared internal hook, hooks/use-focus-after-render.ts, used by both components. The test failed with focus on <body>.
6.5 ExportMenu: the button is aria-disabled while exporting instead of disabled, so focus returns to it as the menu closes. The menu can't be opened again until the export finishes. The test failed with focus on <body>.

Skipped ([P] / device check)

  • 6.6 (SortableList, Form while processing, comment composer): needs a browser.
  • 6.7 (slash menu inside a modal dialog): needs a browser.

Could not reproduce

  • None.

Behaviour/API changes worth noting

  • ExportMenu: while exporting, the button is aria-disabled + aria-busy (styled aria-disabled:opacity-50) instead of disabled. The disabled prop still sets native disabled.
  • EditorToolbarProps (internal) no longer accepts ref, because the toolbar uses its own ref on the root.
  • Docs updated: wysiwyg-editor, bulk-actions, additional-files-upload, export-menu.

Verification

  • pnpm lint, pnpm format:check, pnpm typecheck: pass
  • pnpm --filter @javaabu/onu exec vitest run --maxWorkers=3: 197 files, 2863 passed, 1 skipped
  • node scripts/check-docs.mjs: Docs OK
  • pnpm build && pnpm --filter @javaabu/onu size: pass, no budget changes

🤖 Generated with Claude Code

agent and others added 6 commits November 18, 2026 05:31
…rmation (#66, 6.1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed (#66, 6.3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 6.4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the other hooks; the build will only add the banner to modules
that declare it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@n4ff4h
n4ff4h merged commit 5e9807c into dev Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant